<template name="projects">
  <div class="project-list stretch">
  <ul class="nav nav-list">
    <li class="nav-header">
      Projects
      <div class="btn-group pull-right">
        <a class="btn btn-small btn-info" id="add-project" title="Add project"><i class="icon-plus-sign"></i></a>
      </div>
    </li>
    <li class="{{isFilterSelected all }} filter-project" data-id="" data-name=""><a href="#">Total ({{totalUnfinished null}})</a></li>
    {{#each parentProjects}}
    <li class="{{isFilterSelected _id }} filter-project" data-id="{{_id}}" data-name="{{name}}"><a href="#">{{ name }} ({{totalUnfinished _id}})</a></li>
    {{#each childProjects _id}}
    <li class="{{isFilterSelected _id }} filter-project child" data-id="{{_id}}" data-name="{{name}}"><a href="#">{{ name }} ({{totalUnfinished _id}})</a></li>
    {{/each}}
    {{/each}}
  </ul>
  </div>

  <div class="toolbar-bottom">
    <div class="btn-group" id="filter-type" data-toggle="buttons-radio">
      <button class="btn {{ isActiveMember }}" id="filter-member" title="My tasks"><i class="icon-user"></i></button>
      <button class="btn {{ isActiveTeam }}" id="filter-team" title="Team tasks"><i class="icon-group"></i></button>
    </div>
  </div>

  {{>projectDialog}}
</template>